package edu.zut.enumerate;

public class Test {
    public static void main(String[] args) {
        User user = new User();
        user.setName("jack");
        user.setSex(Gender.male);
        user.setAge(20);
        user.setEducation(Edu.本科);
        System.out.println("user = " + user);
        //values 获取当前枚举类中的所有值
        Gender.values();
        //根据枚举元素名称获取枚举值
        Gender gender = Gender.valueOf("male");
        System.out.println("gender = " + gender);
        int id = gender.id;
        System.out.println("id = " + id);
    }

}
